﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/management.Master" AutoEventWireup="true" CodeBehind="personalinfo.aspx.cs" Inherits="pcsse.management.personalinfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="hoder_sidebar" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="hoder_maincontent" runat="server">
<div class="p_title">
个人信息
</div>
    <asp:DetailsView ID="pDv" runat="server" AutoGenerateRows="False" 
        DataKeyNames="ID" DataSourceID="pDvOds" Height="50px" Width="500px">
        <EmptyDataTemplate>
            <asp:Label ID="emptyLb" runat="server" Text="请先登录"></asp:Label>
        </EmptyDataTemplate>
        <Fields>
            <asp:TemplateField HeaderText="学号" SortExpression="NUMBER">
                <EditItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("NUMBER") %>'></asp:Label>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("NUMBER") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("NUMBER") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="姓名" SortExpression="NAME">
                <EditItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("NAME") %>'></asp:Label>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("NAME") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("NAME") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="性别" SortExpression="GENDER">
                <EditItemTemplate>
                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("GENDER") %>'></asp:Label>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("GENDER") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("GENDER") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="民族" SortExpression="NATIONALITY">
                <EditItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("NATIONALITY") %>'></asp:Label>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("NATIONALITY") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("NATIONALITY") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="出生日期" SortExpression="BIRTHDAY">
                <EditItemTemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("BIRTHDAY", "{0:d}") %>'></asp:Label>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox4" runat="server" 
                        Text='<%# Bind("BIRTHDAY", "{0:yyyy-mm-dd}") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("BIRTHDAY", "{0:d}") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="证件号码" SortExpression="IDNUMBER">
                <EditItemTemplate>
                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("IDNUMBER") %>'></asp:Label>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("IDNUMBER") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("IDNUMBER") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="联系方式" SortExpression="TELEPNONE">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Height="20px" 
                        Text='<%# Bind("TELEPNONE") %>' Width="150px"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="TextBox1" ErrorMessage="联系方式不正确" 
                        ValidationExpression="(\d{11})|(\(\d{3}\)|\d{3}-)?\d{8}"></asp:RegularExpressionValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("TELEPNONE") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label8" runat="server" Text='<%# Bind("TELEPNONE") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="电子邮件" SortExpression="EMAIL">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Height="20px" 
                        Text='<%# Bind("EMAIL") %>' Width="200px"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                        ControlToValidate="TextBox2" ErrorMessage="电子邮件格式不正确" 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("EMAIL") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label9" runat="server" Text='<%# Bind("EMAIL") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="权限" SortExpression="PRIORITY_ID">
                <EditItemTemplate>
                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("PRIORITY_ID") %>'></asp:Label>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("PRIORITY_ID") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("PRIORITY_ID") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="True" />
        </Fields>
        <FieldHeaderStyle Width="100px" />
    </asp:DetailsView>
    <asp:ObjectDataSource ID="pDvOds" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByID" 
        TypeName="managementTableAdapters.T_PERSONINFOTableAdapter" 
        UpdateMethod="UpdateQuery">
        <UpdateParameters>
            <asp:Parameter Name="NUMBER" Type="String" />
            <asp:Parameter Name="NAME" Type="String" />
            <asp:Parameter Name="GENDER" Type="String" />
            <asp:Parameter Name="NATIONALITY" Type="String" />
            <asp:Parameter Name="BIRTHDAY" Type="DateTime" />
            <asp:Parameter Name="IDNUMBER" Type="String" />
            <asp:Parameter Name="TELEPNONE" Type="String" />
            <asp:Parameter Name="EMAIL" Type="String" />
            <asp:Parameter Name="PRIORITY_ID" Type="Int32" />
            <asp:Parameter Name="Original_ID" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:SessionParameter Name="Original_ID" SessionField="ID" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:Label ID="errLb" runat="server"></asp:Label>
    <br />
</asp:Content>
